package com.xlh.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

import com.xlh.adapter.GridViewAndListViewAdapter;

public class MyGridView extends GridView {

	public GridViewAndListViewAdapter getDataAdapter() {
		return dataAdapter;
	}

	public void setDataAdapter(GridViewAndListViewAdapter dataAdapter) {

		this.dataAdapter = dataAdapter;
		this.setAdapter(this.dataAdapter);
	}

	private GridViewAndListViewAdapter dataAdapter;



	public MyGridView(Context context) {
		this(context,null);
		// TODO Auto-generated constructor stub
	}

	public MyGridView(Context context, AttributeSet attrs) {
		this(context,attrs,0);
		// TODO Auto-generated constructor stub
	}

	public MyGridView(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		// TODO Auto-generated constructor stub
	}
	
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		// TODO Auto-generated method stub
		int expandMeasure = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);
		super.onMeasure(widthMeasureSpec,expandMeasure);

	}
}
